
#ifndef ADTTANGGAL_H
#define ADTTANGGAL_H

//Selector
#define Day(T) ((T).DD)
#define Month(T) ((T).MM)
#define Year(T) ((T).YY)

#include <stdio.h>
#include "..\Boolean\Boolean.h"
#include <time.h>

//Definisi tipe jam (DD/MM/YY)
typedef struct {
	int DD;
	int MM;
	int YY;
} date;

//Validasi
bool IsTanggalValid(int D, int M, int Y);

//Konstruktor
date MakeTanggal(int h, int b, int t);

//Baca tulis
void BacaTanggalP(date* T);
void TulisTanggal(date T);

//Operator
date NextDay(date D);
date PrevDay(date D);
date NextNDay(date D, int N);
date PrevNDay(date D, int N);
int HariKe(date D);

//Predikat
int GetMonthDay(int M, int Y);
bool IsEqD(date D1, date D2);
bool IsBefore(date D1, date D2);
bool IsAfter(date D1, date D2);
bool IsKabisat(int Y);

//Time.h
date GetCurrentDate();

#endif
